package com.fh.utils.intercept;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author whf
 * @date 2023年04月25日 15:22
 */
@Configuration
public class MvcWebConfig implements WebMvcConfigurer {
    private final LoginIntercept loginInterceptor;

    public MvcWebConfig(LoginIntercept loginInterceptor) {
        this.loginInterceptor = loginInterceptor;
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor)
//                .addPathPatterns("/story/*")
                .excludePathPatterns("/swagger-resources","/v2/api-docs" , "/error" , "/webjars" , "/doc.html","/v3/api-docs");
    }
}
